'use strict';
const db = uniCloud.database();
const userInfo = db.collection('Userlnfo')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	
	let userInfoId = await userInfo.add(event);
	
	//返回数据给客户端
	if(!userInfoId){
		return {
			code:400,
			msg:"注册失败"
		}
	}
	
	return {
		code:200,
		msg:"注册成功",
		userInfoId
	}
};
